<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
		<%--审批/单位新增 --%>
		<base href="<%=basePath%>" />
		<title>${title}</title>
		<style type="text/css">
			#user_login div label{margin:0px;padding:0px;margin-left:20px;width:60px;height:20px;text-align:right;}
			#txt_name,#txt_pwd{border:1px solid #ccc;width:190px;height:20px;line-height:20px;}
			#user_login div{margin:0px;padding:0px;margin-top:10px;height:25px;width:270px;}
			#user_login{margin:0px;padding:0px;width:270px;height:120px;}
		</style>
		<script type="text/javascript" src="<c:url value='/resource/js/jquery-1.7.2.min.js'/>"></script>
		<script type="text/javascript" src="<c:url value='/resource/artdialog/artdialog.js'/>"></script>
		<script type="text/javascript" src="<c:url value='/resource/artdialog/iframetools.js'/>"></script>
		
		<script type="text/javascript">
			$(function(){
				//$("#user_login").css({"height":"60px"});
			
			});
			/**
			 * 判断是否为空
			 * 
			 * @param id
			 * @param msg
			 * @returns {Boolean}
			 */
			function isEmpty(id, msg) {
				if ("" == $(id).val().replace(/(^\s*)|(\s*$)/g, "")) {
					$("#div_msg").html(msg);
					$(id).focus();
					$(id).select();
					return false;
				}
				return true;
			}
			/**
			 * 清除空格
			 * 
			 * @param targetCmpId
			 * @returns
			 */
			function trimStr(targetCmpId) {
				return $("#" + targetCmpId).val().replace(/(^\s*)|(\s*$)/g, "");
			}
			/**
			 * 表单检验
			 *
			 */
			function checkForm(){
				return isEmpty("#txt_name","请输入用户名！")&&isEmpty("#txt_pwd","请输入密码！");
			}
			/**
			 * 用户登录
			 *
			 */
			function login(){
				if(checkForm()){
					$.post("<c:url value='/profile/auth.json'/>", {
						policeNum : trimStr("txt_name"),
						password : trimStr("txt_pwd")
					}, function(data) {
						if (1 == data.msg.status) {
							art.dialog.close();
						}else {
							$("#div_msg").html(data.msg.body);
						}
					});
				}
				return false;
			}
			/**
			 * 退出系统
			 *
			 */
			function exitSys(){
				top.window.location.href="<c:url value='/profile/login.html'/>";
			}
		</script>
</head>
<body style="margin:0px;padding:0px;width:270px;height:90px;overflow:hidden;font-size:12px;">
	<div id="user_login" style="margin:0px;padding:0px;height:120px;overflow:hidden;">
		<div>
			<label>用户名:</label>
			<input id="txt_name" type="text" maxlength="15"/><span style="color:red;">*</span>
		</div>
		<div>
			<label>密　码:</label>
			<input id="txt_pwd" type="password" maxlength="15"/><span style="color:red;">*</span>
		</div>
		<div id="div_msg" style="margin:0px;margin-top:5px;width:210px;padding-left:60px;height:20px;color:red;overflow:hidden;"></div>
	</div>
</body>
</html>